<html>
<head>
   <script src="../../Grid/GridE.js"> </script>
</head>
<body class="Tutorial">
   <style>
      
      /* Tutorial shared styles */
      .Tutorial h1,.Tutorial h2,.Tutorial ul,.Tutorial .Desc,.Tutorial .Path,.Tutorial .Xml { max-height:999999px; }
      .Tutorial h1 { font:30px Arial; padding:5px 0px 5px 0px; margin:0px; text-align:center; }
      .Tutorial h2 { font:15px Arial; padding:0px; margin:0px 0px 10px 0px; text-align:center; color:#757575; }
      .Tutorial h3,.Tutorial h4 { display:inline-block; font:bold 15px Arial; padding:0px 5px 0px 5px; border-radius:2px; color:black; margin:2px; font-style:normal; color:#333; }
      .Tutorial h3 { background:#EE9; border:1px solid #DD8; }
      .Tutorial h4 { background:#BDE; border:1px solid #ACD; }
      .Tutorial a { text-decoration:underline; }      
      .Tutorial li { padding-bottom:8px; }
      .Tutorial ul { margin:6px 0px 0px 20px; font:13px Arial; }
      .Tutorial > ul { margin-left:0px; padding-left:15px; clear:both; }
      .Tutorial ul b { color:#0585B9; }
      .Tutorial .Path { font:normal 12px Arial; color:#0585B9; }
      .Tutorial .Path b { color:#D73938; }
      .Tutorial .Path u { text-decoration:none; color:black; font-weight:bold; padding:0px 2px 0px 2px; }
      .Tutorial .Xml { margin-bottom:6px; font-size:12px; color:#757575; }
      .Tutorial .Border { border:1px solid #dfdfdf; padding:10px 20px 10px 20px; margin:0px 8px 20px 0px; min-width:100%; box-sizing:border-box; }
      .Tutorial .Main { }

      /* Styles special for this example */
      .Bold { font-size:12px; font-weight:bold; }
      
   </style>

   <center class="Path"><script>document.write(location.href.replace(/(.*)(\/Tutorials\/)([^\/]+)\/([^\/]+)$/,"$2<b>$3</b>/$4").replace(/([^<]|^)(\/|\.)/g,"$1<u>$2</u>"));</script></center>
   <h1>1. Simple nested master detail</h1>
   <h2>Simple master detail relation with detail tables shown as children of master rows</h2>

   <center class="Border" id="Border">
      <div class="Xml">Source: <a href='01-Master.js'>01-Master.js</a> &nbsp; <a href='01-Detail.js'>01-Detail.js</a></div>
      <div class="Main" style='width:100%; height:600px;'>
         <bdo Debug='check' DebugCheckIgnore='ADDRESS,NOTE' Data_Url='01-Master.js'></bdo>
      </div>
   </center>
   <ul>
      <li>
         Data rows in master detail relation are always defined only in master grid. Changes in both tables are also uploaded only from master grid.<br />
         <b style='color:black;'>In simple nested relation are detail data defined as <b>children of one child</b> of master rows.</b><br />
      </li>
      <li>
         In master rows define one child row (<b>"detail parent"</b>) that will show the nested grid in one of its cells.<br />
         In the detail parent row children define the detail rows to be shown in the nested detail grid.<br />
      </li>
      <li>
         In the detail parent row define attribute <h3>DetailCol</h3> to column name where to show the detail grid.<br />
         It is often good to span more (or even all) cells in this row to have more room for the detail grid. Use row attribute <b>Spanned</b> and cell attribute <b>Span</b>.<br />
      </li>
      <li>
         In the detail parent row define attribute <h3>DetailLayout</h3> to specify XML/JSON layout for the detail grid. It can direct XML/JSON string or URL to download the data from.<br />
         If you need to set more options for the detail grid data sources, you can use <b>DetailTreeGrid</b> attribute instead.
      </li>
      <li>
         In the detail parent row define attributes <b>Expanded='0' CanExpand='0'</b> to not show the detail children in master grid.
      </li>
      <li>
         Opposite to external detail grids you don't need to define the detail columns in master grid. <br />
         If you use debug='check' to check errors in your XML, you will receive warnings for unknown attributes for these columns in detail rows. In this case you can ignore these warnings. Or list them in DebugCheckIgnore.
      </li>
      <li>
         You can set attributes <b>Sync</b> and <b>SyncId</b> and optionally <b>CfgId</b> to synchronize all the detail grids.<br />
         For example if a user changes size of column in one detail grid, all other detail grids will be resized accordingly. Similarly for sorting, filtering, grouping and search settings.
      </li>
   </ul>

   <!-- Google Analytics code run once for trial -->
   <script>
      var TGTrial = document.cookie.match(/TGTrialMaster\s*=\s*(\d+)/), TGIndex = 1;
      if(!TGTrial||!(TGTrial[1]&TGIndex)) setTimeout(function(){
         var n = "RunTrialGridMaster1", d = (new Date((new Date).getTime()+31536000000)).toUTCString(); document.cookie = "TGTrialMaster="+((TGTrial?TGTrial[1]:0)|TGIndex)+";expires="+d;
         var u = document.cookie.match(/TGTrialUsed\s*=\s*(\d+)/); u = u ? u[1]-0+1 : 1; if(u<=11) document.cookie = "TGTrialUsed="+u+";path=/;expires="+d;
         var s = "<div style='width:0px;height:0px;overflow:hidden;'><iframe src='http"+(document.location.protocol=="https"?"s":"")+"://www.treegrid.com/Stat/GA.html?productName="
               +(u==1||u==3||u==5||u==10?"UsedTrial"+u:n)+"' onload='var T=this;setTimeout(function(){document.body.removeChild(T.parentNode.parentNode);},1000);'/></div>";
         var F = document.createElement("div"); F.innerHTML = s; document.body.appendChild(F);
         },100);
   </script>
</body>
</html>